<!--
  ~ Copyright 2009 Joachim Ansorg, mail@ansorg-it.com
  ~ File: trap.html, Class: trap.html
  ~ Last modified: 2010-01-27
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <meta name="generator" content="HTML::TextToHTML v2.51"/>
</head>
<body>
<p>trap: trap [-lp] [[arg] signal_spec ...]
</p>

<p> Trap signals and other events.

</p>

<p> Defines and activates handlers to be run when the shell receives signals
    or other conditions.

</p>

<p> ARG is a command to be read and executed when the shell receives the
    signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC
    is supplied) or `-', each specified signal is reset to its original
    value. If ARG is the null string each SIGNAL_SPEC is ignored by the
    shell and by the commands it invokes.

</p>

<p> If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. If
    a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command.

</p>

<p> If no arguments are supplied, trap prints the list of commands associated
    with each signal.

</p>
<dl>
    <dt>Options</dt>
    <dd> -l print a list of signal names and their corresponding numbers
        -p display the trap commands associated with each SIGNAL_SPEC

    </dd>
</dl>
<p> Each SIGNAL_SPEC is either a signal name in &lt;signal.h&gt; or a signal number.
    Signal names are case insensitive and the SIG prefix is optional. A
    signal may be sent to the shell with "kill -signal $$".

</p>

<p> Exit Status:<br/>
    Returns success unless a SIGSPEC is invalid or an invalid option is given.</p>

</body>
</html>
